package com.leyou.order.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.order.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @package com.leyou.order.mapper
 * @description: 订单表的操作接口
 * @author: 许超越
 * @date 2019/7/12 10:23
 * @version: V1.0
 */
public interface OrderMapper extends BaseMapper<Order> {


    /**
     * 查询逾期未支付的订单
     * @param deadline
     * @return
     */
    @Select("SELECT order_id FROM tb_order WHERE status = 1 AND create_time <= #{deadline}")
    List<Long> queryOverdueUnpaidOrder(@Param("deadline") Date deadline);
}
